import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './registerServiceWorker'
import './rem'
import axios from 'axios'
import VueLazyload from 'vue-lazyload'

//let baseUrl='ttps://netease2.bluej.cn'
////拦截器
//axios.interceptors.request.use(function(config){
//	console.log(config)
//	config.url=baseUrl+config.url
//	return config;
//})

Vue.use(VueLazyload,{
	loading:require('../public/img/lazy.gif')
})

Vue.config.productionTip = false

router.beforeEach((to,from,next)=>{
//	console.log("to",to);
//	console.log("from",from);
	let isLogin = to.matched.some((ele)=>{return ele.meta.download});
	if(isLogin){
		let isDown = localStorage.getItem("isDownload");
		if(isDown){
			next();
		}else{
			next({
				path:"/downApp",
				query:{redirectURL:to.fullPath}
			})
		}
		
	}else{
		next();
	}
	
})


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

